package org.siteanalyser.util;

/**
 * Simple utility for calculating percentages.
 * 
 * @author Luc Russell
 */
public class PercentageCalculator {

    public static double aIsWhatPercentOfB(final double a, final double b) {
        return (a / b) * 100;
    }

    public static double whatIsAPercentOfB(final double a, final double b) {
        return (a / 100) * b;
    }

    public static double whatIsPercentageIncreaseDecrease(final double a, final double b) {
        return (b - a) / a * 100;
    }
}
